byteNot
Type
operator
Summary
Performs a "bitwise not" operation on each bit of a string of binary data.
Syntax
byteNot <data>
Description
Use the byteNot operator to operate directly on the bits of a binary string.
For each bit of data, LiveCode performs an not operation with the corresponding to produce a result. A bit is 1 if the corresponding bits of data is 0. A bit is 0 if the corresponding bits of data is 1.
Parameters
Name | Type | Description |
---|---|---|
data | binary data, or an expression that evaluates to binary data |
Examples
/* Data represented in memory as 00000010 00000001 */
local tData
put numToByte(2) & numToByte(1) into tData
/* Result represented in memory as 1111101 1111110 */
local tResult
put byteNot tData into tResult
/* Equivalent to using bitNot and then converting to data */
put tResult is numToByte((bitNot 2) bitAnd 0xFF) & numToByte((bitNot 1) bitAnd 0xFF) -- true
Related
glossary: operation, operator, bit, binary, operand, binary data
Compatibility and Support
Introduced
LiveCode 10.0
OS
mac
windows
linux
ios
android
Platforms
desktop
server
mobile